package com.kingyea.gradle.task;

import org.gradle.api.DefaultTask;
import org.gradle.api.tasks.TaskAction;

public class MyTask extends DefaultTask {

	@TaskAction
	public void listUsers() {
		User user = this.getProject().getExtensions().getByType(User.class);
		if(user!=null) {
			System.out.println(user);
		} else {
			System.out.println("task myName is not exists");
		}
	}
	
	public void sayHello(String name) {
		System.out.println("hello " + name);
	}
	
	@TaskAction
	public void listUsers2() {
		System.out.println("listUsers2");
	}
}
